<?php
/**
* @version		$Id:default.php 1 2014-07-20 09:49:36Z Hoang Yen $
* @copyright	Copyright (C) 2014, Hoang Yen. All rights reserved.
* @license 		http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
?>
<div class="componentheading<?php echo $this->escape($this->get('pageclass_sfx')); ?>"><h2><?php echo $this->params->get('page_title');  ?></h2></div>

<div class="contentpane">
	  <table>
		<thead>
			<tr>
			  <th width="5">
					<?php echo JText::_('COM_RESTAURANTMANAGE_ORDER_STT'); ?>
				</th>
				<th>
					<?php echo JText::_('COM_RESTAURANTMANAGE_ORDER_ALIAS'); ?>
				</th>
				<th>
					<?php echo JText::_('COM_RESTAURANTMANAGE_ORDER_CUSTOMERNAME'); ?>
				</th>
				<th>
					<?php echo JText::_('COM_RESTAURANTMANAGE_ORDER_CUSTOMERPHONE'); ?>
				</th>
				<th>
					<?php echo JText::_('COM_RESTAURANTMANAGE_ORDER_CUSTOMERNUMBERS'); ?>
				</th>
				<th>
					<?php echo JText::_('COM_RESTAURANTMANAGE_ORDER_ORDERDATE'); ?>
				</th>
				<th>
					<?php echo JText::_('COM_RESTAURANTMANAGE_ORDER_DESCRIPTION'); ?>
				</th>
				<th>
				</th>
			</tr>
		</thead>
		<tfoot></tfoot>
			<?php foreach($this->items as $i => $item): 
			$item->slug	= $item->alias ? ($item->id.':'.$item->alias) : $item->id;
			$link = JRoute::_('index.php?option=com_restaurantmanage&view=zorder&id='. $item->slug);
			?>
			  	<tr class="row<?php echo $i % 2; ?>">
					<td>
						<?php echo $item->id; ?>
					</td>
					<td>
						<?php echo $item->alias; ?>
					</td>
					 <td>
					 	<?php echo $item->customer_name; ?>
					 </td>
					 <td>
					 	<?php echo $item->customer_phone; ?>
					 </td>
					 <td>
					 	<?php echo $item->customer_numbers; ?>
					 </td>
					<td>
						<?php echo $item->order_date; ?>
					</td>
					 <td>
					 	<?php echo $item->description; ?>
					 </td>
					 <td>
					 	<button onclick="window.location.href='<?php echo $link ?>'" style="font-size: smaller">
					 		<?php echo JText::_('COM_RESTAURANTMANAGE_ORDER_DETAIL'); ?>
					 	</button>
					 </td>
				</tr>
			<?php endforeach; ?>	
		</tbody>
	</table>
	<h2>Tao don dat hang</h2>
	<form action="<?php echo JRoute::_('index.php')?>" enctype="multipart/form-data" method="post">
	  	<ul>
	  		<li>
	  			<span style="float: left; width: 100px;"><?php echo $this->form->getLabel('alias'); ?></span> 
	  			: <?php echo $this->form->getInput('alias'); ?>
	  		</li>
	  		<li>
	  			<span style="float: left; width: 100px;"><?php echo $this->form->getLabel('customer_name'); ?></span> 
	  			: <?php echo $this->form->getInput('customer_name'); ?>
	  		</li>
	  		<li>
	  			<span style="float: left; width: 100px;"><?php echo $this->form->getLabel('customer_phone'); ?></span> 
	  			: <?php echo $this->form->getInput('customer_phone'); ?>
	  		</li>
	  		<li>
	  			<span style="float: left; width: 100px;"><?php echo $this->form->getLabel('customer_numbers'); ?></span> 
	  			: <?php echo $this->form->getInput('customer_numbers'); ?>
	  		</li>
	  		<li>
	  			<span style="float: left; width: 100px;"><?php echo $this->form->getLabel('order_date'); ?></span> 
	  			: <?php echo $this->form->getInput('order_date'); ?>
	  		</li>
	  		<li>
	  			<span style="float: left; width: 100px;"><?php echo $this->form->getLabel('description'); ?></span> 
	  			: <?php echo $this->form->getInput('description'); ?>
	  		</li>
	  		<li>
		        <button type="submit" style="width: 100px;">
		            <?php echo JText::_('JSAVE') ?>
		        </button>
	  		</li>
	  	</ul>
	  	<!-- PATH -->
	  	<input type="hidden" name="option" value="com_restaurantManage" />
	    <input type="hidden" name="task" value="zorder.addOrder" />
		<input type="hidden" name="view" value="zorders" />
		<?php echo JHTML::_( 'form.token' ); ?>
	</form>
</div>
 